home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
Software
/
BostonBusinessComputing
/
bbc
/
vcllp
< prev
next >
Wrap
Text File
|
2000-02-11
|
2KB
|
94 lines
: vcllp - /bin/sh wrapper for VCL show commands calling the
: native unix print commands: lp, lpr, lpq, cancel...
:
: Edit History
: $Log: vcllp.prod,v $
: Revision 1.2 1991/06/10 13:55:45 cpl
: corrected lpr argument to specify printer.
:
: Revision 1.1 1991/06/07 13:35:26 cpl
: Initial revision
:
:
: sysv_args sort of relate to system V printer commands, but not
: always.
: bsd_args works under the same assumption
cmnd=$1
shift
case $cmnd in
PRINT)
sysv_args="lp "
bsd_args="lpr "
if [ "$q_QUEUE" != "" ]; then
printer=`echo $q_QUEUE | sed -e 's/[:]$//'`
sysv_args=$sysv_args" -d"$printer
bsd_args=$bsd_args" -P"$printer
else
if [ "$q_DEVICE" != "" ]; then
printer=`echo $q_DEVICE | sed -e 's/[:]$//'`
sysv_args=$sysv_args" -d"$printer
bsd_args=$bsd_args" -P"$printer
fi
fi
if [ "$q_JOB_COUNT" != "" ]; then
sysv_args=$sysv_args" -n"$q_JOB_COUNT
bsd_args=$bsd_args" -#"$q_JOB_COUNT
fi
if [ "$q_NAME" != "" ]; then
sysv_args=$sysv_args" -t"$q_NAME
bsd_args=$bsd_args" -J"$q_NAME
fi
if [ "$q_NOTIFY" != "" -a "$q_NOTIFY" != "0" ]; then
sysv_args=$sysv_args" -w"
bsd_args=$bsd_args" -m"
fi
if [ "$q_DELETE" != "" -a "$q_DELETE" != "0" ]; then
bsd_args=$bsd_args" -r"
fi
if [ "$q_PASSALL" != "" -a "$q_PASSALL" != "0" ]; then
bsd_args=$bsd_args" -l"
fi
bsd_args=$bsd_args" "$*
sysv_args=$sysv_args" "$*
;;
CANCEL)
sysv_args="cancel "
bsd_args="lprm "
if [ "$1" != "" ]; then
bsd_args=$bsd_args" -P"$1
fi
if [ "$q_ENTRY" != "" ]; then
entries=`echo $q_ENTRY | sed -e 's/,/ /g'`
fi
sysv_args=$sysv_args" "$entries" "$1
bsd_args=$bsd_args" "$entries
;;
SHOWQUEUE)
sysv_args="lpstat "
bsd_args="lpq "
if [ "$q_FILES" != "" -a "$q_FILES" != "0" ]; then
bsd_args=$bsd_args" -l"
fi
;;
*)
echo "%VCL-W-IVARG, invalid argument"
exit 1
;;
esac
trap "/bin/rm -f /tmp/$$.prt" 0 1 2 3 10 14 15
exec 3>/tmp/$$.prt
($bsd_args 2>&3) 2>/dev/null || ($sysv_args 2>&3) 2>/dev/null ||\
if [ ! -s /tmp/$$.prt ]; then
echo "%VCL-W-NOPRINT, print operation failed"
else
cat /tmp/$$.prt 1>&2
fi